<template>
  <li class="list-group-item">
    <div class="handle">
<!--      <button @click="delCom(index)">删除</button>-->
      <button @click="delItem">删除</button>
    </div>
    <p class="user"><span >{{ comment.name }}</span><span>说:</span></p>
    <p class="centence">{{ comment.content }}</p>
  </li>
</template>

<script>
export default {
  name: 'Item',
  props: {
    comment: Object,
    index: Number,
    delCom: {
      type: Function,
      required: true
    }
  },
  methods: {
    delItem () {
      const {comment, index, delCom} = this
      console.log(comment)
      delCom(index)
    }
  }
}
</script>

<style scoped>

</style>
